package com.brillilab.service.core.system.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.brillilab.common.constant.ClientTypeEnum;
import com.brillilab.dao.mapper.system.ClientVersionMapper;
import com.brillilab.domain.enums.system.ClientVersionTypeEnum;
import com.brillilab.domain.po.system.ClientVersion;
import com.brillilab.service.core.system.IClientVersionService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @author wuzhiyu
 * @Title: ClientVersionServiceImpl
 * @ProjectName brill_lab
 * @Description: TODO
 * @date 2019/5/917:14
 */
@Service
@Transactional
public class ClientVersionServiceImpl implements IClientVersionService {
    @Resource
    private ClientVersionMapper clientVersionMapper;
    @Override
    public ClientVersion getVersionInfo(ClientVersionTypeEnum clientType) {
        LambdaQueryWrapper<ClientVersion> query = new LambdaQueryWrapper<>();
        query.eq(ClientVersion::getClientType,clientType.getType());
        return clientVersionMapper.selectOne(query);
    }
}
